import { _decorator, Component, director, Node } from 'cc';
import { ResourceMgr } from '../../framework/manager/ResourceMgr';
const { ccclass, property } = _decorator;

@ccclass('MoonHome')
export class MoonHome extends Component {

    private started: boolean;

    onLoad(): void {
        this.started = false;
        ResourceMgr.Instance.addButtonListen(this.node.getChildByName("StartBtn"), this, this.navToGame)    
    }
 
    private navToGame(){
        if(this.started){
            return;
        }
        this.started = true;
        director.loadScene("MoonGame")
    }
}

